import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNotEmpty, Length } from 'class-validator';

export class ChangePasswordDto {
  @ApiProperty({
    example: '123456',
    description: '旧密码',
  })
  oldPassword?: string;

  @ApiProperty({
    example: '123456',
    description: '新密码',
  })
  @IsNotEmpty({ message: '新密码必填' })
  @IsString()
  @Length(6, 30, { message: '密码长度为6位到30位！' })
  password: string;

  @ApiProperty({
    example: '123456',
    description: '确认密码',
  })
  @IsNotEmpty({ message: '确认密码必填' })
  @IsString()
  @Length(6, 30, { message: '密码长度为6位到30位！' })
  checkPassword: string;
}
